
import 'package:du_application/pages/HomePage.dart';
import 'package:flutter/material.dart';
import '../routes/application.dart';
class SettingProvide with ChangeNotifier {
  Color themeColor = Colors.white;
  Color fonts=Colors.black;
  int selectIndex=1;

  // 改变主题颜色
  void changeTheme(color,font){
    themeColor = color;
    fonts=font;
  notifyListeners();
  }
   void selectBar(index,context){
     if(selectIndex==index){
       return;
     }
   selectIndex=index;
  switch(index){
case 3:Application.router.navigateTo(context, "/person");break;
case 1:Application.router.navigateTo(context, "/classify");break;
case 2:Application.router.navigateTo(context, "/affairList");break;
case 0:{
  
  Navigator.of(context).pushAndRemoveUntil(
    new MaterialPageRoute(builder: (context)=>HomePage()),
     (route)=>route==null
);
break;
}

  }
  
   notifyListeners();
  }
  
}